<?php
class WeifaAction extends CommonAction{
	function Index(){
		$this->display();
	}
	public function Typelist(){
		echo '[
	{"typeid":"101", "orgName":"《无照经营查处取缔办法》"},
	{"typeid":"102", "orgName":"《中华人民共和国产品质量法》"},
	{"typeid":"103", "orgName":"《中华人民共和国食品安全法》"},
	{"typeid":"104", "orgName":"《反不正当竞争法》"},
	{"typeid":"105", "orgName":"《中华人民共和国广告法》"},
	{"typeid":"106", "orgName":"《中华人民共和国商标法》"},
	{"typeid":"107", "orgName":"《甘肃省查处生产、销售假冒伪劣商品行为条例》"},
	{"typeid":"108", "orgName":"《城乡个体工商户管理暂行条例》"},
	{"typeid":"109", "orgName":"《中华人民共和国公司法》"},
	{"typeid":"110", "orgName":"《中华人民共和国个人独资企业法》"},
	{"typeid":"111", "orgName":"《中华人民共和国消费者权益保护法》"},
	{"typeid":"112", "orgName":"《国务院关于加强食品等产品安全监督管理的特别规定》"},
	{"typeid":"201", "orgName":"其它法律依据"}
]';
	}
	function insert(){
		
	$model = D ('Weifa');
	$model->create();
	if (false === $model->create ()) {
		$this->error ( $model->getError () );
	}
	$model->typeid = $_POST['org1_typeid'];//处罚依据类型
	$model->yiju = $_POST['org1_orgName'];//处罚依据具体名称	
	$list=$model->add ();
	//echo D()->getLastSql();	
	if ($list!==false){
	echo '{"statusCode":"200", 
      "message":"添加成功，请继续添加或取消。",
      "callbackType":"closeCurrent",
      "navTabId":""}';	
	}
	else {
		echo '{"statusCode":"300", 
      "message":"添加失败，请检查",
      "callbackType":"closeCurrent",
      "navTabId":""}';	
	}
	}
}
?>